Imports System.Data.SqlClient
Imports Microsoft.ApplicationBlocks.Data.SqlHelper

Public Class Pallets
    Public Function GenerarPallet(ByVal CodINP, ByVal Fec, ByVal Can, ByVal Obs)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "PalletGenerar", New SqlParameter("@CodINP", CodINP), _
        New SqlParameter("@Fec", Fec), New SqlParameter("@Can", Can), New SqlParameter("@Obs", Obs))
        Return DS
    End Function

    Public Function ObtenerPallets(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, _
        CommandType.StoredProcedure, "PalletsObtener", New SqlParameter("@CodIOT", Dat(0)), _
        New SqlParameter("@CodINP", Dat(1)))
        Return DS
    End Function

    Public Function ModificarPallet(ByVal ParamArray Dat() As String)
        Dim DS As New DataSet
        DS = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, CommandType.StoredProcedure, "PalletModificar", _
        New SqlParameter("@CodPal", CInt(Dat(0))), New SqlParameter("@Fec", CDate(Dat(1))), New SqlParameter("@Can", CLng(Dat(2))), _
        New SqlParameter("@Ubi", Dat(3)), New SqlParameter("@Obs", Dat(4)))
        Return ds
    End Function

    Public Function ObtenerPalletsPorCodNP(ByVal CodNP As Integer)
        Return Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(My.Settings.MiCadena, "PalletsObtenerByNotaPedido", CodNP)
    End Function

    Public Function ObtenerPalletsByINP(ByVal IdINP As Integer)
        Dim DS As New DataSet
        DS = ExecuteDataset(My.Settings.MiCadena, CommandType.StoredProcedure, "PalletsObtenerByINP", IdINP)
        Return DS
    End Function
End Class